<?php
	/**
	* Elgg view validate
	*/
?>
<div class="blog_post">
  <h3>
    <a href="<?php echo $vars['entity']->getURL(); ?>"><?php echo $vars['entity']->title; ?></a>
  </h3>
  <!-- display the user icon -->
  <div class="blog_post_icon">
    <?php
      echo elgg_view("profile/icon",array('entity' => $vars['entity']->getOwnerEntity(), 'size' => 'tiny'));
    ?>
  </div>
  <p class="strapline">
    <?php
      setlocale(LC_TIME, 'fr_FR.UTF-8');
      echo sprintf(elgg_echo("blog:strapline"),strftime('%d %B %Y',$vars['entity']->time_created));
    ?>
    <?php echo elgg_echo('by'); ?>
    <a href="<?php echo $vars['url']; ?>pg/blog/<?php echo $vars['entity']->getOwnerEntity()->username; ?>"><?php echo $vars['entity']->getOwnerEntity()->name; ?></a> &nbsp; 
    <!-- display the comments link -->
    <?php
      //get the number of comments
      $num_comments = elgg_count_comments($vars['entity']);
    ?>
    <a href="<?php echo $vars['entity']->getURL(); ?>"><?php echo sprintf(elgg_echo("comments")) . " (" . $num_comments . ")"; ?></a><br />
  </p>
  <!-- display tags -->
  <p class="tags">
    <?php
      echo elgg_view('output/tags', array('tags' => $vars['entity']->tags));
    ?>
  </p>
  <div class="clearfloat"></div>
  <div class="blog_post_body">
  <!-- display the actual blog post -->
    <?php
      echo autop($vars['entity']->description);
    ?>
  </div>
  <div class="clearfloat"></div>			
  <!-- display edit options if it is the blog post owner -->
  <p class="options">
    <?php
      if ($vars['entity']->canEdit()) {
    ?>
        <a href="<?php echo $vars['url']; ?>mod/blog/edit.php?blogpost=<?php echo $vars['entity']->getGUID(); ?>"><img src="<?php echo $vars['url']; ?>mod/uvsq/graphics/iconEdit.gif"><?php echo elgg_echo("edit"); ?></a>  &nbsp; 
        <?php
          echo elgg_view("output/confirmlink", array(
                          'href' => $vars['url'] . "action/blog/delete?blogpost=" . $vars['entity']->getGUID(),
                          'text' => '<img src="'.$vars['url'].'mod/uvsq/graphics/iconDelete.gif" />' . elgg_echo('delete'),
                          'confirm' => elgg_echo('deleteconfirm'),
                        ));
        ?>
          <a href="<?php echo $vars['url']; ?>mod/validation_peda/avis.php?guid=<?php echo $vars['entity']->getGUID(); ?>"><img src="<?php echo $vars['url']; ?>mod/uvsq/graphics/iconAvis.gif"><?php echo elgg_echo("avis:titre"); ?></a>  &nbsp; 
        <?php
        // Allow the menu to be extended
        echo elgg_view("editmenu",array('entity' => $vars['entity']));
        ?>
      <?php
      }
      ?>
  </p>
</div>
<div id="example" class="flora">
  <ul id="pel_menu">
    <li><a href="#fragment-1"><span><?php echo elgg_echo('categorie:validation'); ?></span></a></li>
    <li><a href="#fragment-2"><span><?php echo elgg_echo('comments'); ?></span></a></li>
  </ul>
  <div id="fragment-1">
    <?php
      echo elgg_view('rate/rate', array('entity'=> $vars['entity']));
    ?>
  </div> 
  <div id="fragment-2">
    <?php
      echo elgg_view_comments($vars['entity']);
    ?>
  </div> 
</div>